에너지사용량 자료
Make this Notebook Trusted to load map: File -> Trust Notebook
<folium.features.Choropleth at 0x7f08225ae050>
<folium.features.Choropleth at 0x7f0858b4dbd0>
Make this Notebook Trusted to load map: File -> Trust Notebook
2018~2019년도 전기사용량 (서울)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[5], line 1
----> 1 seoul_dict = local_dict.copy() 
      2 seoul_dict['features'] = [l for l in seoul_dict['features'] if l['properties']['code'][:2] == '11']
      3 fig = px.choropleth_mapbox(
      4     geojson = seoul_dict,
      5     featureidkey = 'properties.code',
   (...)
     15     zoom=9,
     16 )

NameError: name 'local_dict' is not defined
2018~2019년도 에너지사용량 (전국)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[6], line 1
----> 1 fig = df2.drop(['code_local','code'],axis=1)\
      2 .set_index(['년도','시도','지역','건물동수','연면적']).stack().reset_index()\
      3 .rename({'level_5':'에너지종류', 0:'에너지사용량'},axis=1)\
      4 .assign(에너지종류 = lambda df: df['에너지종류'].str.split('/').str[-1])\
      5 .groupby(['년도','시도','에너지종류']).agg({'에너지사용량':'sum'})\
      6 .stack().reset_index()\
      7 .rename({0:'에너지사용량'},axis=1)\
      8 .plot.area(
      9     x='년도',y='에너지사용량',
     10     color='시도',
     11     facet_col='에너지종류'
     12 )
     13 fig.update_layout(
     14     xaxis_domain=[0.0, 0.25],
     15     xaxis2_domain=[0.35, 0.60],
     16     xaxis3_domain=[0.70, 0.95]
     17 )

NameError: name 'df2' is not defined